import React from 'react';
import CheckImg from '../../resources/images/check.png';

const OnlyWithAudioCheckbox = ({ setConnectOnlyWithAudio, connectOnlyWithAudio }) => {
	
	const handleConnectionTypeChange = () => {
		setConnectOnlyWithAudio(!connectOnlyWithAudio);
	};
	
	return (
		<div className='checkbox_container' onClick={handleConnectionTypeChange}>
			<div className='checkbox_connection'>
				{
					connectOnlyWithAudio &&
					<img className='checkbox_image' src={CheckImg} />
				}
			</div>
			<p className='checkbox_container_paragraph'>只开启音频</p>
		</div>
	);
};

export default OnlyWithAudioCheckbox;
